import service from '@/utils/requests'
import requests from '@/utils/requests'
import request from '@/utils/request-java.js'
// import req from '../req';
// 冷站信息
export function getlzmsg() {
  return requests({
    url: '/oao/p003/last_power_data',
    method: 'get',
    params: { key: '3' }
  });
}
// 获取实时数据
export function getdwMsg() {
  return requests({
    url: '/oao/p003/last_typical_point_data',
    method: 'get',
    params: { key: '3' }
  });
}
// 获取设备数据
export function getSbMsg() {
  return requests({
    url: '/oao/p003/last_val',
    method: 'get',
    params: { key: '3' }
  });
}

// type为hour
export function Analysis(data) {
  return request({
    url: '/IndicatorController/dataHour',
    method: 'post',
    data: data
  });
}
// 过去十二个月能耗
export function dataMonth(data) {
  return request({
    url: '/IndicatorController/dataMonth',
    method: 'post',
    data: data
  });
}
// type为scalar
export function Scalar(data) {
  return request({
    url: '/IndicatorController/dataScalar',
    method: 'post',
    data: data
  });
}

// 获取数据
export function ProjectGroupone(data) {
  return request({
    url: '/IndicatorController/data',
    method: 'post',
    data: data
  });
}


export function getShuShiList() {
  // console.log(data,'data',[data,a]);
  return service({
    url: '/getYunXing',
    method: 'get',
    // data: data
  });
}
// 获取点位数据
export function getDeviceList(data) {
  // console.log(data,'data',[data,a]);
  return service({
    url: '/oao/p003/last_val',
    method: 'get',
    params: { key: 3, typ: data }
  });
}
//获取后端数据接口
export function getConfiguration(data) {
  return request({
    url: '/WorkOrderConfigurationController/list',
    method: 'get',
    params: { ...data, limit: 10 }
  });
}
// 确认提交
export function updateConfiguration(data) {
  return service({
    url: '/updateConfiguration',
    method: 'post',
    data: data
  });
}
//提交工单到列表
export function updateWorkerOrder(data) {
  return service({
    url: '/updateWorkOrder',
    method: 'post',
    data: data
  });
}
// 获取工单数量
export function getGonDan() {
  return request({
    url: '/StrokeLisdataController/getCount',
    method: 'get'
  });
}

//获取操作人员绩效
export function getStaffData(data) {
  return request({
    url: '/StaffPerformanceController/list',
    method: 'get',
    params: { ...data, limit: 10 }
  });
}

//添加工单配置到工单列表
export function getQueryAdd(data) {
  return request({
    url: '/StrokeLisdataController/add',
    method: 'post',
    params: data
  });
}
//提交工单到列表
export function delWorkerOrder(data) {
  return request({
    url: '/WorkOrderConfigurationController/remove',
    method: 'delete',
    params: data
  });
}

// 获取区域舒适性数据
export function getAreaComfort(type) {
  return service({
    url: '/oao/p003/last_area_status',
    method: 'get',
    params: { key: 3, typ: type }
  });
}

// 获取冷机台数
export function getLengZhanNum(type) {
  return service({
    url: '/oao/p003/active_refrigerator',
    method: 'get',
    params: { key: 3, typ: type }
  });
}

// 获取总功率，冷量
export function getLengZongleng(type) {
  return service({
    url: '/oao/p003/last_refrigration_data',
    method: 'get',
    params: { key: 3, typ: type }
  });
}


// 获取冷机设备运行时间
export function getLengZhanTable(type) {
  return service({
    url: '/oao/p003/uptime',
    method: 'get',
    params: { key: 3, typ: type }
  });
}

